package com.terrynoya.fight.evaluation
{
	public class Char
	{
		private static const LETTER_REG:RegExp = /[a-z]/i;
		private static const DIGIT_REG:RegExp = /[0-9]/;
		
		public function Char()
		{
			
		}
		
		public static function isLetter(value:String):Boolean
		{
			if(value.length != 1)
			{
				return false;
			}
			var char:String = value.charAt(0);
			var rlt:Boolean = LETTER_REG.test(char);
			return rlt;
		}
		
		public static function isWhiteSpace(value:String):Boolean
		{
			if(value.length != 1)
			{
				return false;
			}
			var char:String = value.charAt(0);
			return char == " ";
		}
		
		public static function isDigit(value:String):Boolean
		{
			if(value.length != 1)
			{
				return false;
			}
			var char:String = value.charAt(0);
			return DIGIT_REG.test(char);
		}
		
		public static function isLetterOrDigit(value:String):Boolean
		{
			return isLetter(value) || isDigit(value);
		}
	}
}